//////////////////////////////////////////////////////////////////////
// sparse_detail.h
//
// SHEN Fangyang
// me@shenfy.com
//
// Copyright (C) SHEN Fangyang, 2011, All rights reserved.
//////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////
//  Brief Description
//
//	SIMPLE LINEAR ALGEBRA PACKAGE
//
//	Calls to Intel(R) MKL (version >= 10.2)
//	including sparse BLAS, LAPACK
//
//////////////////////////////////////////////////////////////////////
#pragma once

namespace grflib
{
	namespace LA
	{
		namespace bindings
		{
			namespace detail
			{
				void csrmv(char TRANS, 
					const int &m,
					const int &n,
					const float &alpha,
					const char *matdescra,
					const float *pValue,
					const int *pIndices,
					const int *ptrB,
					const int *ptrE,
					const float *x,
					const float &beta,
					float *y)
				{
					mkl_scsrmv(&TRANS, 
						const_cast<int *>(&m), 
						const_cast<int *>(&n), 
						const_cast<float *>(&alpha), 
						const_cast<char *>(matdescra),
						const_cast<float *>(pValue), 
						const_cast<int *>(pIndices), 
						const_cast<int *>(ptrB), 
						const_cast<int *>(ptrE), 
						const_cast<float *>(x), 
						const_cast<float *>(&beta), 
						y);
				}

				void csrmv(char TRANS, 
					const int &m,
					const int &n,
					const double &alpha,
					const char *matdescra,
					const double *pValue,
					const int *pIndices,
					const int *ptrB,
					const int *ptrE,
					const double *x,
					const double &beta,
					double *y)
				{
					mkl_dcsrmv(&TRANS, 
						const_cast<int *>(&m), 
						const_cast<int *>(&n), 
						const_cast<double *>(&alpha), 
						const_cast<char *>(matdescra),
						const_cast<double *>(pValue), 
						const_cast<int *>(pIndices), 
						const_cast<int *>(ptrB), 
						const_cast<int *>(ptrE), 
						const_cast<double *>(x), 
						const_cast<double *>(&beta), 
						y);
				}

			} //namespace detail
		} //namespace bindings
	} //namespace LA
} //namespace grflib